using System;
using System.Windows.Navigation;
using Microsoft.Phone.Tasks;
using WindowsPhoneEssentials.Tasks;

namespace WindowsPhoneEssentials.Testing
{
    public class TestTaskManager : ITaskManager
    {
        /// <summary>
        /// Specifies the return task arguments given the Type of the chooser
        /// </summary>
        public Func<Type, TaskEventArgs> Returns { get; set; }

        public void StartTask<TChooser, TTaskEventArgs>(Action<TTaskEventArgs> onComplete)
            where TChooser : ChooserBase<TTaskEventArgs>, new()
            where TTaskEventArgs : TaskEventArgs
        {
            onComplete((TTaskEventArgs)Returns(typeof(TChooser)));
        }

        public void ComposeEmail(string to = null, string cc = null, string bcc = null, string subject = null, string body = null, int? codePage = null)
        {
        }

        public void ShowWebsiteInBrowser(string uri)
        {
        }

        public void ShowWebsiteInApp(string uri, bool showAppBar = true, Action<Uri, NavigationService> navigateCallback = null)
        {
        }
    }
}